'use strict';

const Controller = require('egg').Controller;

class MyController extends Controller {
  /**
   * 用户列表
   */
  async list() {
    let list = await this.ctx.service.user.list();
    this.ctx.body = list;
  }
  async oneUser() {
    const result = await this.ctx.service.user.oneUser();
    if (result) {
      this.ctx.body = result;
    } else {
      this.ctx.body = '用户不存在';
    }
  }
  async add() {
    const result = await this.ctx.service.user.oneUser();
    this.ctx.body = result;
  }
  async delete() {
    this.body = 'delete';
  }
  async edit() {
    this.body = 'edit';
  }
}

module.exports = MyController;